package stool.observerpattern.part1;

/**
 * @Author Felix YF Dong
 * @Date 2021/5/7
 */
public class Main {

    public static void main(String[] args) {

        Boss boss = new Boss();

        StockObserver stockObserver1 = new StockObserver("stockObserver1", boss);
        StockObserver stockObserver2 = new StockObserver("stockObserver2", boss);

        boss.attach(stockObserver1);
        boss.attach(stockObserver2);

        boss.setAction("发布通知");
        boss.nofifyInfo();

        boss.detach(stockObserver1);
        boss.setAction("再次发布通知");
        boss.nofifyInfo();

    }
}
